package nrpc.register;

import java.io.IOException;

import nrpc.client.ClientStub;
import nrpc.impl.SubscriberHandler;

public class Subscriber {

	private ClientStub stub;
	private SubscriberHandler proxy;
	
	public Subscriber(String host, int port) {
		try {
			stub = new ClientStub(host, port);
		} catch (IOException e) {
			e.printStackTrace();
		}
		proxy = stub.getProxyInstance(SubscriberHandler.class);
	}
	
	public SubscriberHandler getHandler(){
		return proxy;
	}
	
	public void close(){
		stub.close();
	}
	
}
